<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<div>
	<h3>Confirmação de Dados Cadastrais</h3>
	<hr>
</div>

<form name="cadastrarContaForm" action="realizarCadastros.do" method="post">
	<c:choose>
		<c:when test="${cadastroNovaConta}">
			<input type="hidden" name="metodo" value="cadastrarContas"/>
		</c:when>
		<c:otherwise>
			<input type="hidden" name="metodo" value="cadastrarDados"/>
		</c:otherwise>
	</c:choose>
	
	<div>
		<c:if test="${not empty novoUsuario}">
		<fieldset>
			<legend>Dados do novo usuário</legend>
				<TABLE>
					<TR>
						<TD>Usuário</TD>
						<TD><input type="text" value="${novoUsuario.login}" readonly="readonly"/></TD>
					</TR>
					<TR>
						<TD>Senha:</TD>
						<TD><input type="password" value="${novoUsuario.senha}" readonly="readonly"/></TD>
					</TR>
					<TR>
						<TD>Confirmação de Senha:</TD>
						<TD><input type="password" value="${novoUsuario.senha}" readonly="readonly"/></TD>
					</TR>
				</TABLE>
		</fieldset>
		</c:if>
		<c:forEach var="contaEmail" items="${contas}">
			<fieldset>
			<legend>Dados da nova Conta</legend>
				<TABLE>
					<TR>
						<TD>Endereço de Email</TD>
						<TD><input type="text" value="${contaEmail.enderecoEmail}" readonly="readonly"/></TD>
					</TR>
					<TR>
						<TD>Senha:</TD>
						<TD><input type="password" value="${contaEmail.senha}" readonly="readonly"/></TD>
					</TR>
					<TR>
						<TD>Confirmação de Senha:</TD>
						<TD><input type="password" value="${contaEmail.senha}" readonly="readonly"/></TD>
					</TR>
				</TABLE>
		</fieldset>
		</c:forEach>
		<div>
			<input type="submit" value="Concluir" name="confirmarCadastro-concluir"/>
			<input type="button" value="Cancelar" name="confirmarCadastro-cancelar" onclick="if(confirm('Deseja realmente cancelar o cadastro?')){location = 'telaPrincipal.do'};"/>
		</div>
	</div>
</form>